package com.henry.sprite;

import java.awt.*;

public class MoverFactory {
    enum Shape {
        Rectangle, Oval
    }
    enum MoveType {
        Straight, Bouncing
    }
    public static Mover getMover(Shape shape, Color color, int width, int height, MoveType moveType, int startX, int startY, int dX, int dY) {
        Sprite s;
        switch (shape) {
            case Rectangle:
                s = new Rectangle(width, height, color);
                break;
            case Oval:
                s = new Oval(width, height, color);
                break;
            default:
                throw new IllegalStateException("Unexpected value: " + shape);
        }
        Mover m;
        switch (moveType) {
            case Straight:
                m = new StraightMover(startX, startY, dX, dY, s);
                break;
            case Bouncing:
                m = new Bouncer(startX, startY, dX, dY, s);
                break;
            default:
                throw new IllegalStateException("Unexpected value: " + moveType);
        }
        return m;
    }
}
